<template>
	<view class="add">
		<view class="uni-list">

			<view class="uni-list-cell">
				<view class="uni-list-cell-navigate">
					<view class="iconfont icon-zhanghao"></view>
					<input type="text" placeholder="请输入卡号" v-model="no" />
				</view>
			</view>
			<view class="uni-list-cell">
				<view class="uni-list-cell-navigate">
					<view class="iconfont icon-mima"></view>
					<input type="text" password="true" placeholder="请输入密码" v-model="password">
				</view>
			</view>
		</view>
		
		<view class="radius-btn" @tap="transfer()">提交</view>
	</view>
</template>

<script>
	import Request from '../../common/request.js';
	
	export default {
		data() {
			return {
				no: '',
				password:'',
			};
		},
		onLoad() {
			
		},
		methods: {
			transfer:function(){
				if(!this.no) {
					Request.alert('请填写充值卡卡号');
					return;
				}

				
				if(!this.password) {
					Request.alert('请填写充值卡密码');
					return;
				}
				
				var that = this;
				Request.send({
					url: 'recharge/cardRecharge',
					data: {
						no:that.no, 
						password:that.password
					},
					sCallback: function(res) {
						uni.showToast({
							title: res.msg,
							success() {
								uni.navigateBack({
									
								})
							}
						})
					}
				})

				
			}
		}
	}
</script>

<style>
	.add{
		font-size: 28upx;
		margin-top: 60upx;
	}
	
	.add .radius-btn{
		margin-top: 70upx;
	}
	
	.add picker{
		margin-right: 20upx;
	}
	
	.add .iconfont{
		width: 80upx;
		font-size: 40upx;
	}
	
	.add input{
		flex: 1;
	}
</style>
